<?php

namespace app\common\model;

use think\Model;
use traits\model\SoftDelete;

class Zbrateconfig extends Model
{

    use SoftDelete;

    

    // 表名
    protected $name = 'zbrateconfig';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'int';

    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = false;
    protected $deleteTime = 'deletetime';

    // 追加属性
    protected $append = [
        'symbol_text'
    ];
    

    
    public function getSymbolList()
    {
        return ['range' => __('Range'), '>' => __('>'), '<=' => __('<='), '' => __('')];
    }


    public function getSymbolTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['symbol']) ? $data['symbol'] : '');
        $list = $this->getSymbolList();
        return isset($list[$value]) ? $list[$value] : '';
    }




}
